package AbstractFactory;

public class AbstractFactoryPatternDemo {
    /*
        超级工厂, 其他工厂的工厂.
     */

    public static void main(String[] args) {

        FactoryProducer factoryProducer = new FactoryProducer();

        AbstractFactory shapeFactory = factoryProducer.getFactory("Shape");
        AbstractFactory colorFactory = factoryProducer.getFactory("Color");

        Shape circle = shapeFactory.getShape("Circle");
        Color red = colorFactory.getColor("red");

        circle.draw();
        red.fill();

    }

}
